Skip to main content

M-Pesa Statement Analysis

POST https://api.manka.tz/api/v1/analysis/1d

This analyses the pdf and generates the report. The response is in a json format.

Header Requirements

  • Authorization --required

Body Params

  • file --required
  • fullname --required
curl example request
curl -X 'POST' 'https://api.manka.tz/api/v1/analysis/1d'
-F fullname=Hussein \
-F 'file=@M_Pesa_789981_Statement.pdf' \
-H 'Authorization: Bearer XXXXXXXXXXX' \'

Response Sample

  1. Status OK Response
200 OK
[
{
"account": "2557XXXXXXXX",
"contacts": "2557XXXXXXXX",
"company": "Vodacom",
"start_date": "2024-06-01T08:35:00",
"end_date": "2024-10-29T10:32:00",
"no_of_transactions": 981,
"in_types": [
"bank_to_wallet",
"agent_deposit",
"p2p_received",
"other"
],
"out_types": [
"luku",
"p2p_sent",
"wallet_to_bank",
"agent_withdrawal",
"lipa",
"bill_payment",
"other"
],
"loan_services": [
"songesha",
"mpawa",
"chomoka",
"mgodi"
],
"pars_3d": {
"agent_activity": {
"debit": [
"agent_withdrawal"
],
"credit": [
"agent_deposit"
]
},
"peer_to_peer_activity": {
"debit": [
"p2p_sent"
],
"credit": [
"p2p_received"
]
},
"bank_activity": {
"debit": [
"wallet_to_bank"
],
"credit": [
"bank_to_wallet"
]
},
"loan_activity": {
"debit": [
"songesha",
"mpawa",
"chomoka",
"mgodi"
]
},
"bills_activity": {
"debit": [
"bill_payment",
"luku",
"gepg"
]
},
"lipa_info": {
"debit": [
"lipa"
]
},
"other": {
"debit": [
"other"
],
"credit": [
"other"
]
}
},
"channels": {}
},
{
"initial_info": {
"account_number": "255756339626",
"first_date": "2024-06-01 08:35:00",
"last_date": "2024-10-29 10:32:00",
"total_days": 151,
"total_active_days": 106
},
"customer_profile": {
"wallet_balance": 0.04,
"total_turnover": 43060444.0,
"total_transactions": 981
},
"cash_flow_summary": {
"total_turnover": 43060444.0,
"total_cashin": 21676377.0,
"total_cashout": 21384067.0,
"cashin_to_turnover_percentage": 50.34,
"cashin_transactions": 335,
"cashin_to_total_trans_percentage": 34.15,
"cashout_to_turnover_percentage": 49.66,
"cashout_transactions": 646,
"cashout_to_total_trans_percentage": 65.85
},
"songesha_info": {
"total_amount_songesha_disbursed": 5339305.0,
"max_amount_songesha_disbursed": 183920.0,
"number_of_songesha_disbursements": 255,
"average_songesha_disbursement_amount": 20938.45,
"last_day_of_songesha_disbursement": "2024-10-29 10:32:00",
"last_songesha_disbursement_amount": 10000.0,
"total_amount_songesha_repaid": 5722356.0,
"max_amount_songesha_repaid": 197714.0,
"number_of_songesha_repayments": 293,
"average_songesha_repayment_amount": 19530.23,
"last_day_of_songesha_repayment": "2024-10-29 10:10:00",
"last_songesha_repayment_amount": 30000.0
},
"mpawa_info": {
"total_amount_mpawa_disbursed": 0,
"max_amount_mpawa_disbursed": 0,
"number_of_mpawa_disbursements": 0,
"average_mpawa_disbursement_amount": 0,
"last_day_of_mpawa_disbursement": "N/A",
"last_mpawa_disbursement_amount": 0,
"total_amount_mpawa_repaid": 0,
"max_amount_mpawa_repaid": 0,
"number_of_mpawa_repayments": 0,
"average_mpawa_repayment_amount": 0,
"last_day_of_mpawa_repayment": "N/A",
"last_mpawa_repayment_amount": 0
},
"chomoka_info": {
"total_amount_chomoka_disbursed": 0,
"max_amount_chomoka_disbursed": 0,
"number_of_chomoka_disbursements": 0,
"average_chomoka_disbursement_amount": 0,
"last_day_of_chomoka_disbursement": "N/A",
"last_chomoka_disbursement_amount": 0,
"total_amount_chomoka_repaid": 0,
"max_amount_chomoka_repaid": 0,
"number_of_chomoka_repayments": 0,
"average_chomoka_repayment_amount": 0,
"last_day_of_chomoka_repayment": "N/A",
"last_chomoka_repayment_amount": 0
},
"mgodi_info": {
"total_amount_mgodi_disbursed": 0,
"max_amount_mgodi_disbursed": 0,
"number_of_mgodi_disbursements": 0,
"average_mgodi_disbursement_amount": 0,
"last_day_of_mgodi_disbursement": "N/A",
"last_mgodi_disbursement_amount": 0,
"total_amount_mgodi_repaid": 0,
"max_amount_mgodi_repaid": 0,
"number_of_mgodi_repayments": 0,
"average_mgodi_repayment_amount": 0,
"last_day_of_mgodi_repayment": "N/A",
"last_mgodi_repayment_amount": 0
},
"bank_to_wallet": {
"total_bank_to_wallet_amount": 3005499.0,
"maximum_bank_to_wallet_amount": 990000.0,
"no_of_bank_to_wallet_transactions": 29,
"average_bank_to_wallet_amount": 103637.9,
"last_day_paid_bank_to_wallet": "2024-10-09 07:00:00",
"last_bank_to_wallet_amount": 20000.0
},
"agent_deposit": {
"total_agent_deposit_amount": 4560000.0,
"maximum_agent_deposit_amount": 1500000.0,
"no_of_agent_deposit_transactions": 9,
"average_agent_deposit_amount": 506666.67,
"last_day_paid_agent_deposit": "2024-10-22 03:09:00",
"last_agent_deposit_amount": 300000.0
},
"p2p_received": {
"total_p2p_received_amount": 6944688.0,
"maximum_p2p_received_amount": 2000000.0,
"no_of_p2p_received_transactions": 25,
"average_p2p_received_amount": 277787.52,
"last_day_paid_p2p_received": "2024-10-26 10:01:00",
"last_p2p_received_amount": 310000.0
},
"other": {
"total_other_amount": 5445096.0,
"maximum_other_amount": 1500000.0,
"no_of_other_transactions": 71,
"average_other_amount": 76691.49,
"last_day_paid_other": "2024-10-29 10:10:00",
"last_other_amount": 30000.0
},
"luku": {
"total_luku_amount": 85000.0,
"maximum_luku_amount": 20000.0,
"no_of_luku_transactions": 6,
"average_luku_amount": 14166.67,
"last_day_paid_luku": "2024-09-23 05:27:00",
"last_luku_amount": 15000.0
},
"p2p_sent": {
"total_p2p_sent_amount": 2687500.0,
"maximum_p2p_sent_amount": 600000.0,
"no_of_p2p_sent_transactions": 55,
"average_p2p_sent_amount": 48863.64,
"last_day_paid_p2p_sent": "2024-10-27 02:20:00",
"last_p2p_sent_amount": 13000.0
},
"wallet_to_bank": {
"total_wallet_to_bank_amount": 225000.0,
"maximum_wallet_to_bank_amount": 135000.0,
"no_of_wallet_to_bank_transactions": 3,
"average_wallet_to_bank_amount": 75000.0,
"last_day_paid_wallet_to_bank": "2024-10-21 07:13:00",
"last_wallet_to_bank_amount": 135000.0
},
"agent_withdrawal": {
"total_agent_withdrawal_amount": 622500.0,
"maximum_agent_withdrawal_amount": 260000.0,
"no_of_agent_withdrawal_transactions": 18,
"average_agent_withdrawal_amount": 34583.33,
"last_day_paid_agent_withdrawal": "2024-10-09 07:59:00",
"last_agent_withdrawal_amount": 8000.0
},
"lipa": {
"total_lipa_amount": 2273800.0,
"maximum_lipa_amount": 135000.0,
"no_of_lipa_transactions": 110,
"average_lipa_amount": 20670.91,
"last_day_paid_lipa": "2024-10-29 10:32:00",
"last_lipa_amount": 9500.0
},
"bill_payment": {
"total_bill_payment_amount": 6149700.0,
"maximum_bill_payment_amount": 2000000.0,
"no_of_bill_payment_transactions": 107,
"average_bill_payment_amount": 57473.83,
"last_day_paid_bill_payment": "2024-10-28 10:30:00",
"last_bill_payment_amount": 7000.0
},
"transaction_channels": {},
"statement_check": {
"isvalid": true
}
}
]

  1. Bad Request Response
400 Bad Request
message: "<The specific error message>"

  1. Unauthorized
401 Unauthorized request
{
"detail": "Forbidden"
}
  1. Unprocessable Entity
422 Unprocessable file entity
{
"detail": [
{
"loc": [
"body",
"fullname"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}
  1. Rate Limit Error
429 Rate Limited Error
message: "Rate limited resource",
nexttime:"19876543"

  1. Internal Server Error
500 Internal Server Error
message: "An Internal server error",

Rate Limiting!

Rate Limited Resource Continous Access will lead to blocking an account.